setSource

open fun setSource(idx: Int)

Sets and plays the source specified by playlist index (0 based).

Indexes greater than the size of the playlist will wrap.

Parameters

idx

the index of the source in the playlist


open fun setSource(source: Source)

Sets and plays the specified Source in the playlist.

Parameters

source

the source


open fun setSource(idx: Int, play: Boolean)

Set the source by index (0 based). Indexes greater than the size of the playlist will wrap.

Only available from version 2.1.144 on.

Parameters

idx

the index of the source in the playlist

play

set false to only set current index and not start playback


open fun setSource(source: Source, play: Boolean)

Sets the current source.

This method allows you to change the currently active media source. It is only available from version 2.1.144 onwards.

Parameters

source

The new Source to be set. This source must be present in the current playlist. If the provided source is not found in the playlist, or if the playlist is null or empty, this method will have no effect.

play

If set to true, playback will start immediately after setting the new source. If set to false, the source will be set, but playback will not start automatically. This parameter influences whether pending "next" or "auto-next" actions are cleared and whether a new "next" action is scheduled.